"""Bazel module for Garmin Connect IQ development tools."""

module(
    name = "rules_ciq",
    version = "0.1.0",
)

bazel_dep(name = "bazel_skylib", version = "1.8.2")
bazel_dep(name = "rules_cc", version = "0.2.14")
bazel_dep(name = "rules_rust", version = "0.67.0")
bazel_dep(name = "stardoc", version = "0.8.0")
bazel_dep(name = "platforms", version = "1.0.0")

new_local_repository = use_repo_rule("@bazel_tools//tools/build_defs/repo:local.bzl", "new_local_repository")

new_local_repository(
    name = "osx_homebrew",
    path = "/opt/homebrew",
    build_file = "local_repositories/osx_homebrew/BUILD.bazel",
)

rust = use_extension("@rules_rust//rust:extensions.bzl", "rust")
rust.toolchain(
    edition = "2021",
    versions = ["1.85.0"],
)

crate = use_extension("@rules_rust//crate_universe:extensions.bzl", "crate")
crate.spec(package = "anyhow", version = "1.0")
crate.spec(package = "clap", version = "4.4", features = ["derive"])
crate.spec(package = "image", version = "0.24")
crate.spec(package = "libc", version = "0.2")
crate.spec(package = "regex", version = "1.12.2")
crate.spec(package = "tokio", version = "1.36.0", features = ["full"])
crate.spec(package = "xml", version = "1.1.0")
crate.from_specs()
use_repo(crate, "crates")

local_ciq = use_repo_rule("//:local_ciq.bzl", "local_ciq")
local_ciq(name = "local_ciq")
